package com.base.cn.platform.os.controller.marketing.baseShare;

import com.base.cn.platform.os.common.controller.BaseController;
import com.base.cn.platform.os.common.utils.result.ResultUtil;
import com.base.cn.platform.os.entity.marketing.baseShare.MarketingBaseShare;
import com.base.cn.platform.os.service.marketing.baseShare.MarketingBaseShareBiz;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 海报分享Controller
 *
 * @author zsw
 * @create 2019-04-18
 */
@RestController
@RequestMapping("/manage")
public class MarketingBaseShareController extends BaseController {

    @Autowired
    private MarketingBaseShareBiz marketingBaseShareBiz;

    /**
     * 保存海报分享数据
     *
     * @param
     * @return
     */
    @RequestMapping("/saveBaseShare")
    public Map<String,Object> saveBaseShare(@RequestBody MarketingBaseShare marketingBaseShare){
        marketingBaseShareBiz.updateById(marketingBaseShare,null);
        return ResultUtil.SUCCESS("海报数据保存成功");
    }

    /**
     * 查询分享海报数据
     * @return MarketingBaseShare 分片海报数据对象
     */
    @RequestMapping("/queryBaseShare")
    public MarketingBaseShare queryBaseShare(){
        return marketingBaseShareBiz.queryBaseShare();
    }

}
